var {
  getWorkCount
} = require('../../utils/api');
const app = getApp();

Page({

 data: {
  list: app.globalData.listzu,
  count:0,
  index: 0,
  uname:'',
  current: 0,
 },

 onLoad: function (options) {
   let _this = this;
    //获取当前工作人员待处理事项的总数

    if (app.globalData.userInfo) { //老用户查询
      _this.setData({
        uname:app.globalData.userInfo.name
      })

    }

 },
 onShow(){
   //页面显示的时候，更新页面数据
  let _this = this;
  getWorkCount(app.globalData.id).then((res) => {
    console.log(res);
    if(res[1]){
      _this.setData({
        count:res[1]
      })
    }
  })

 },

 //最下面的tab点击事件
 tabChange(e) {
  let _this = this;
  this.setData({
    index: e.detail.index
  }, () => {
    if (e.detail.index == 1) {
     
    }
  })
},

//待处理
onclickdai(){
  wx.navigateTo({
      url: '../worklist/index',
  })
},

//已处理
onclickyi(){
  wx.navigateTo({
    url: '../worklist/index',
})

},
progress(){
  wx.navigateTo({
    url: '../workhistory/index',
})
}
})